import { Component } from "react"

class Dong extends Component {
    constructor() {
        super()
        this.state = {
            a: {
                b: 1
            }
        }
    }
    componentDidMount() {//生命周期
        setTimeout(() => {
           this.state.a.b=2
           this.setState(this.state)
        },2000);
    }
    render() {
        return (
            <div>
                我是Dong1组件{this.state.a.b}
            </div>
        )
    }
}

export default Dong